(progn
(unless which-key--setup-p (which-key/setup))
;; make echo-keytrokes fast for minibuffer popup
- ;; (it can interfer if it's too slow)
+ ;; (it can interfer if it's too slow)
(when (and (> echo-keystrokes 0)
- (eq which-key-popup-type 'minibuffer))
- (setq echo-keystrokes 0.1))
- (add-hook 'focus-out-hook 'which-key/stop-open-timer)
- (add-hook 'focus-in-hook 'which-key/start-open-timer)
+ (eq which-key-popup-type 'minibuffer))
+ (setq echo-keystrokes 0.1))
+ (add-hook 'pre-command-hook #'which-key/hide-popup)
+ (add-hook 'focus-out-hook #'which-key/stop-open-timer)
+ (add-hook 'focus-in-hook #'which-key/start-open-timer)
(which-key/start-open-timer))
;; make sure echo-keystrokes returns to original value
(setq echo-keystrokes which-key--echo-keystrokes-backup)
- (remove-hook 'focus-out-hook 'which-key/stop-open-timer)
- (remove-hook 'focus-in-hook 'which-key/start-open-timer)
+ (remove-hook 'pre-command-hook #'which-key/hide-popup)
+ (remove-hook 'focus-out-hook #'which-key/stop-open-timer)
+ (remove-hook 'focus-in-hook #'which-key/start-open-timer)
(which-key/stop-open-timer)
(which-key/stop-close-timer)))